package com.gurun.camera.device.util;


import com.danale.sdk.device.constant.DeviceType;
import com.danale.sdk.platform.constant.cloud.ServiceType;
import com.danale.sdk.platform.entity.device.Device;

public class ServiceTypeUtil {
    public static ServiceType getServiceType(Device device){
        if(device == null){
            return ServiceType.PERSONAL_CLOUD_STORAGE;
        }

        if(device.getDeviceType() == DeviceType.IPC){
            return ServiceType.IPCAM;
        }else if(device.getDeviceType() == DeviceType.DVR_SPLIT || device.getDeviceType() == DeviceType.DVR
                || device.getDeviceType() == DeviceType.DVR_NO_MIX_MULTI_CHANNEL ||device.getDeviceType() == DeviceType.DVR_NO_MIX_NO_MULTI_CHANNEL
                || device.getDeviceType() == DeviceType.NVR || device.getDeviceType() == DeviceType.NVR_NO_MIX_MULTI_CHANNEL
                || device.getDeviceType() == DeviceType.NVR_NO_MIX_NO_MULTI_CHANNEL || device.getDeviceType() == DeviceType.NVR_SPLIT){
            return ServiceType.DVR_NVR;
        }else if(device.getDeviceType() == DeviceType.RING){
            return ServiceType.DOORBELL;
        }else if(device.getDeviceType() == DeviceType.GARAGE_DOOR_OPENER_WITH_CAMERA){
            return ServiceType.GARAGE_DOOR;
        }else{
            return ServiceType.IPCAM;
        }
    }
}
